//A post for a pinball machine
//
// (c)2012 Felipe Sanches <fsanches@metamaquina.com.br>
// licensed under GPLv3 or later

rubber_radius=2;
m3_diameter=3;

module post(r=5,R=10,H=30, h=24, d=2, rubber_height=20){
  render(){
    difference(){
      union(){
        cylinder(r1=R-d, r2=r, h=H);

        intersection(){
          cylinder(r1=R, r2=r+d, h=H);
          cube([2*R,2*R,2*h],center=true);
        }
      }
      translate([0,0,-1])
      cylinder(r=m3_diameter/2, h=H+2, $fn=20);

      translate([0,0,rubber_height])
      rotate_extrude()
      translate([r+d + (H-rubber_height)*(R-r-d)/H,0])
      circle(r=rubber_radius, $fn=20);
    }
  }
}

post();


